<?php



class ProductsMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.ProductsMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('products');
		$tMap->setPhpName('Products');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('PRODUCTS_ID', 'ProductsId', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addColumn('PRODUCTS_QUANTITY', 'ProductsQuantity', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addColumn('PRODUCTS_MODEL', 'ProductsModel', 'string', CreoleTypes::VARCHAR, false, 12);

		$tMap->addColumn('PRODUCTS_IMAGE', 'ProductsImage', 'string', CreoleTypes::VARCHAR, false, 64);

		$tMap->addColumn('PRODUCTS_PRICE', 'ProductsPrice', 'double', CreoleTypes::DECIMAL, true, 15);

		$tMap->addColumn('PRODUCTS_DATE_AVAILABLE', 'ProductsDateAvailable', 'int', CreoleTypes::DATE, false, null);

		$tMap->addColumn('PRODUCTS_WEIGHT', 'ProductsWeight', 'double', CreoleTypes::DECIMAL, true, 5);

		$tMap->addColumn('PRODUCTS_STATUS', 'ProductsStatus', 'int', CreoleTypes::TINYINT, true, null);

		$tMap->addForeignKey('PRODUCTS_TAX_CLASS_ID', 'ProductsTaxClassId', 'int', CreoleTypes::INTEGER, 'tax_class', 'TAX_CLASS_ID', true, null);

		$tMap->addForeignKey('MANUFACTURERS_ID', 'ManufacturersId', 'int', CreoleTypes::INTEGER, 'manufacturers', 'MANUFACTURERS_ID', true, null);

		$tMap->addColumn('PRODUCTS_ORDERED', 'ProductsOrdered', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

		$tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

		$tMap->addColumn('DELETED_AT', 'DeletedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

	} 
} 